#pragma once
#include "Common.h"
#include "PageCache.h"

class CentralCache
{
public:
	static CentralCache* GetInstance()
	{
		return &_sInst;
	}

	size_t FetchRangeObj(void*& start, void*& end, size_t num, size_t size);

	Span* GetOneSpan(SpanList& list, size_t size);

	void ReleaseListToSpans(void* start, size_t size);

private:
	static CentralCache _sInst;
	CentralCache() {};
	CentralCache(const CentralCache& c) = delete;
private:
	SpanList _spanlist[NFREE_LISTS];
};